package lpca.controllers 
{
	import flashx.textLayout.edit.ModelEdit;
	import lpca.model.LpcaModel;
	import flash.events.MouseEvent;
	import lpca.steps.LpcaAbstractStep;
	import lpca.utils.Cell;	
	import lpca.utils.Point;
	import lpca.view.ViewMaze;
	import lpca.view.ViewCell;
	import kioschool.controller.PrimaryController;
	/**
	 * @author d.shakshin@gmail.com
	 */
	public class LpcaController 
	{		
		private var model: LpcaModel;
		private static var _instance: LpcaController;
				
		public static const stageWave: int = 1;
		public static const stageTrace: int = 2;
		
		public function handler(event: MouseEvent): void
		{			
			if (!(event.target is ViewCell))
				return ;			
			var vCell: ViewCell = event.target as ViewCell;			
			var point: Point = vCell.getPoint();			
			var cell: Cell = model.getCell(point);			
			cell.checked = true;
			cell.view = vCell;				
			model.setCell(vCell.getPoint(), cell);			
		}			
		
		public function LpcaController(model: LpcaModel) 
		{			
			this.model = model											
		}
		
	}	
}


